﻿namespace OverStore.Runtime.OverStoreContext
{
    using OverStore.Runtime.Logger;
    using OverStore.Runtime.PersistenceServiceProvider;
    using OverStore.Runtime.Storage;
using OverStore.Scoping.Manager;

    /// <summary>
    /// Default implementation of <see cref="IOverStoreContext"/>.
    /// </summary>
    public sealed class OverStoreContextImplementation : IOverStoreContext
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="OverStoreContextImplementation"/> class.
        /// </summary>
        public OverStoreContextImplementation()
        {
            ScopeManager = new OperationScopeManager();
        }

        /// <summary>
        /// Get current session.
        /// </summary>
        public IPersistenceSession CurrentSession { get; set; }

        /// <summary>
        /// Gets the object provides access to different services that allows to perform different task regarding persistence instance of specified type.
        /// </summary>
        public IPersistenceServiceProvider PersistenceServiceProvider { get; set; }

        /// <summary>
        /// Get data source.
        /// </summary>
        public IDataStorage DataStorage { get; set; }

        /// <summary>
        /// Get logger.
        /// </summary>
        public ILogger Logger { get; set; }

        /// <summary>
        /// Gets the current scope manager.
        /// </summary>
        public OperationScopeManager ScopeManager { get; private set; }
    }
}